# run setup
source("setup.R")
# load data
ww1 = readRDS(fs::path("../",controls$savepoint,"ww1.rds"))
shapes = readRDS(fs::path("../",controls$savepoint,"shapes.rds"))

We use measurements of SARS-CoV-2 concentration in wastewater from multiple ARAs in Switzerland in 2022 and 2023. Viral concentration (C, unit: gene copies [gc] per liter) is transformed into viral load (V; unit: gc per day per 100,000) using the flow of wastewater on the same day (F) and the size of the population covered (P): \[ V = \frac{C \times F}{P/100,000} \] Table 1 provides a summary of the available data. Reporting frequencies and periods depended on the ARA, with daily measurements for the full period only available in a few cases (Figure 1). ARAs also sent their samples to different laboratories. In some cases, there were also changes in the method used. SARS-CoV-2 could be detected in the wastewater in most cases, with a few occurrences of no detection (Figure 2). Viral load varied over time, with large heterogeneity across ARAs, although some patterns emerge on visual inspection (Figure 3).

mw_100_desc_table(ww1) %>% 
  dplyr::mutate(across(everything(),as.character)) %>% 
  tidyr::gather() %>% 
  dplyr::rename(Variable=key,Value=value) %>% 
  flextable::flextable(cwidth=c(4,4)) 

Variable

Value

Number of ARAs

118

Number of laboratories

9

Number of laboratory methods

11

Number of measurements

20535

Measurements below LOQ

235

Measurements below LOD

97

First

2022-02-07

Last

2023-05-14

Median viral concentration [gc/L]

1e+05 (range: 0 to 8e+06)

Median flow [m3/day]

1e+04 (range: 3e+02 to 9e+05)

Median viral load [gc/day/100,000]

4e+12 (range: 0 to 7e+14)

Table 1. Summary of available data.

mw_100_desc_table(ww1,NUTS2_name) %>% 
  dplyr::select(1:7)  %>% 
  flextable::flextable(cwidth=rep(4,7)) 

NUTS2_name

Number of ARAs

Number of laboratories

Number of laboratory methods

Number of measurements

Measurements below LOQ

Measurements below LOD

Central

10

1

1

2,471

0

0

Eastern

30

4

5

5,159

42

14

Lake Geneva

18

3

3

2,302

2

5

Mittelland

24

3

4

4,554

51

77

Northwest

17

2

3

2,372

137

0

Ticino

6

2

2

1,268

3

0

Zurich

13

2

2

2,409

0

1

Table 2. Summary of available data by NUTS-2 region.

mw_101_fig_missing(ww1)

Figure 1. Available measurements over time by ARA (grouped by canton).

mw_110_map_missing(ww1,shapes)

Figure 2. Total measurements by ARA.

mw_103_fig_detect(ww1)

Figure 3. SARS-CoV-2 detection in wastewater over time by ARA.

mw_104_fig_vl(ww1)

Figure 4. Weekly mean SARS-CoV-2 viral load in wastewater by ARA (removing values below the LOD or LOQ). Dashed lines show the delimitation in four periods.

mw_111_map_vl(ww1,shapes)

Figure 5. Mean SARS-CoV-2 viral load in wastewater by ARA by period.

if(FALSE) {
  ggplot(ww1) +
    geom_point(aes(x=pop,y=pop_total)) +
    geom_abline(intercept=0,slope=1)
  
  dd = ww1 %>% 
    group_by(ara_id,ara_name) %>% 
    summarise(pop=max(pop),
              pop_total=max(pop_total)) %>% 
    mutate(rel=(pop_total-pop)/pop,
           abs=pop-pop_total) %>% 
    arrange(-abs(rel))
  ggplot(dd) +
    geom_point(aes(x=ara_name,y=pop),colour="firebrick")+
    geom_point(aes(x=ara_name,y=pop_total),colour="dodgerblue",shape=1) +
    scale_x_discrete(limits=rev) +
    coord_flip() +
  theme(axis.text = element_text(size=5))
}